
  {extend name="public/base"}
  {block name="x-body"}
    <div class="x-body">
        <form class="layui-form">
            {if $id}
                <input type="hidden" name="id" value="{$id}">
            {/if}
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="x-red">*</span>模型名
                </label>
                <div class="layui-input-inline">
                    <select name="model_id">
                        <option value="">请选择模型</option>
                        {volist name="model" id="v"}
                        <option value="{$v.id}" {eq name='v.id' value='$result.model_id'}selected{/eq}>{$v.model_name}</option>
                        {/volist}
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>
          <div class="layui-form-item">
              <label for="spec_name" class="layui-form-label">
                  <span class="x-red">*</span>规格名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="spec_name" name="spec_name" required="" lay-verify="required"
                  autocomplete="off" class="layui-input" value="{$result.spec_name}">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>
              </div>
          </div>
            <div class="layui-form-item layui-form-text">
                <label for="spec_value" class="layui-form-label">
                    规格项
                </label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入内容" id="spec_value" name="spec_value" class="layui-textarea" lay-verify="required">{$result.spec_value}</textarea>
                </div>
                <label class="layui-form-label"></label>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>一行为一个规格项，多个规格项用换行输入
                </div>
            </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="edit" lay-submit="" id="L_repass">
                  {$id ? '修改' : '增加'}
              </button>
          </div>
      </form>
    </div>
    <script>
        formData('{:url("goodsType/goodsSpec_form")}', 'edit', function (){
            window.parent.location.reload();

            var index = parent.layer.getFrameIndex(window.name);
            //关闭当前frame
            parent.layer.close(index);
        }, false);
    </script>
  {/block}